var express = require('express');
var router = express.Router();
var account = require('../views/account');
var verify = require('../views/verify');

// 登录页面
router.get('/sign/', account.sign);

// 注册页面
router.get('/signup/', account.signup);

// 用户注册
router.post('/register/', account.checkRegPwd);
router.post('/register/', account.register);
router.post('/register/', account.redirect);

// 检查用户名是否重复
router.get('/checkuser/', account.checkUser);

// 登录验证
router.post('/login/', verify.checkCaptcha);
router.post('/login/', account.ckUserNameAndPassword);
router.post('/login/', account.signin);

// ajax登录验证
router.post('/ajaxlogin/', account.ajaxSignin);

// 登出
router.get('/logout/', account.logout);
router.get('/logout/', account.redirect);

module.exports = router;